home *** CD-ROM | disk | FTP | other *** search
- Path: isonews.bbn.hp.com!hpbblb!news
- From: Matthias Dittrich <matti>
- Newsgroups: comp.lang.c
- Subject: Re: Is there a problem using memset on a malloc'd memory in HP-C
- Date: 29 Mar 1996 09:01:50 GMT
- Organization: Hewlett-Packard Co.
- Message-ID: <4jg8tu$h4r@hpbblb.bbn.hp.com>
- References: <31a7cc$10b20.32c@NEWS>
- NNTP-Posting-Host: trabant.bbn.hp.com
- Mime-Version: 1.0
- Content-Type: text/plain; charset=us-ascii
- Content-Transfer-Encoding: 7bit
- X-Mailer: Mozilla 1.1N (X11; I; HP-UX A.09.07 9000/712)
- X-URL: news:31a7cc$10b20.32c@NEWS
-
- jul395@prb.mhs.compuserve.com (Jonathan Julian) wrote:
- >I have searched your FAQ and found no reference to this problem.
- >
- >I am having trouble doing a malloc on memory that I allocated via
- >malloc. I malloc'd the memory, memset it and immediately look at it
- >and it is garbage. I have changed my mallocs to callocs, but later in
- >my code I realloc. Since realloc does not initialize and I
- >distrusting of memset I have written a loop to initialize my memory.
- >
- >The structure that I am trying to initialize is an array of pointers
- >to pointers that I would initially like to be NULL. I am on HP
- >a.09.07 using HP-C
- >.....
- I'm also working on this system and I don't know about any problems. Are you
- sure to have initialized the complete memory ? It should be
- number_of_pointers * sizeof(your_pointer).
-
- Good luck,
- Matthias
-
-